package com.cdeledu.synchronized的ObjectClassThis;

/*---------------
输出;
1
2//中间没有时间间隔
---------------*/
public class Material3 {

	private static int data1=1;
    public static void doSome() {
        synchronized (Material.class) {
            try {
                System.out.println(data1);
                Thread.sleep(2000);
            }catch(Exception e) {
                e.printStackTrace();
            }
        }
    }

    public void deOther() {
        synchronized (this) {
            System.out.println(data1);
        }

    }

}
